﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;


public partial class welcom : System.Web.UI.Page
{
    DBHelper db = new DBHelper();

    public int wd_yfb_html = 0;
    public int wd_wwc_html = 0;
    public int wd_wsh_html = 0;
    public int wd_xsh_html = 0;
    public int wd_ywj_html = 0;



    protected void Page_Load(object sender, EventArgs e)
    {
        lblName.Text = Session[AppConfig.SESSION_USER_NAME].ToString();
        getdata();
    }


    public void getdata()
    {
        string userbh = Session[AppConfig.SESSION_USER_BH].ToString();
        int now_year = 0;
        int now_month = 0;
        string now_kq_s_d;
        string now_kq_e_d;
        DateTime now = DateTime.Now;
        int day = now.Day;
        if (day >= 26)
        {
            now_year = now.AddMonths(1).Year;
            now_month = now.AddMonths(1).Month;
            now_kq_s_d = now.Year.ToString() + "-" + now.Month.ToString() + "-26";
            now_kq_e_d = now.AddMonths(1).Year.ToString() + "-" + now.AddMonths(1).Month.ToString() + "-25";
        }
        else
        {
            now_year = now.Year;
            now_month = now.Month;
            now_kq_s_d = now.AddMonths(-1).Year.ToString() + "-" + now.AddMonths(-1).Month.ToString() + "-26";
            now_kq_e_d = now.Year.ToString() + "-" + now.Month.ToString() + "-25";
        }

        string psid = Session[AppConfig.SESSION_USER_PSID].ToString();


        now_kq_e_d = DateTime.Now.ToString("yyyy-MM-dd");
        wd_yfb_html = db.getCount("A_Task", "zx_psid= '" + psid + "' and rq_start>='" + now_kq_s_d + "' and rq_start<='" + now_kq_e_d + "' and [state]=1");
        wd_wwc_html = db.getCount("A_Task", "zx_psid= '" + psid + "' and rq_start>='" + now_kq_s_d + "' and rq_start<'" + now_kq_e_d + "' and [state]=2");
        wd_wsh_html = db.getCount("A_Task", "zx_psid= '" + psid + "' and rq_start>='" + now_kq_s_d + "' and rq_start<='" + now_kq_e_d + "' and [state]=3");
        wd_xsh_html = db.getCount("A_Task", "ys_psid= '" + psid + "' and rq_start>='" + now_kq_s_d + "' and rq_start<'" + now_kq_e_d + "' and [state]=3");
        wd_ywj_html = db.getCount("A_Task", "zx_psid= '" + psid + "' and rq_start>='" + now_kq_s_d + "' and rq_start<='" + now_kq_e_d + "' and [state]=4");

    }


}